<%@ page language="java" pageEncoding="utf-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="/doc/tag" prefix="DOC" %>
<%@ taglib uri="/pf/tag" prefix="PF" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <base href="<PF:basePath/>"/>
    <title>资源文件-<PF:ParameterValue key="config.sys.title"/></title>
    <meta name="description"
          content='<PF:ParameterValue key="config.sys.mate.description"/>'>
    <meta name="keywords"
          content='<PF:ParameterValue key="config.sys.mate.keywords"/>'>
    <meta name="author"
          content='<PF:ParameterValue key="config.sys.mate.author"/>'>
    <meta name="robots" content="noindex,nofllow">
    <jsp:include page="../atext/include-web.jsp"></jsp:include>
    <link rel="stylesheet"
          href="<PF:basePath/>text/lib/kindeditor/themes/default/default.css"/>
    <script charset="utf-8"
            src="<PF:basePath/>text/lib/kindeditor/kindeditor-all.js"></script>
    <script charset="utf-8" src="<PF:basePath/>text/lib/kindeditor/zh_CN.js"></script>
    <link rel="stylesheet"
          href="<PF:basePath/>text/lib/kindeditor/wcpplug/wcp-kindeditor.css"/>
    <script charset="utf-8"
            src="<PF:basePath/>text/lib/kindeditor/wcpplug/wcp-kindeditor.js"></script>
    <script charset="utf-8"
            src="<PF:basePath/>text/lib/super-validate/validate.js"></script>
    <link rel="stylesheet" type="text/css"
          href="text/lib/uploadify/uploadify.css">
    <script type="text/javascript"
            src="text/lib/uploadify/jquery.uploadify-3.1.min.js"></script>
</head>
<style>
    <!--
    .webfile-buttonplus .ke-button-common {
        background-image: none;
        background-color: transparent;
        margin: 0px;
        width: 100px;
    }

    .webfile-buttonplus .ke-button {
        cursor: pointer;
        color: #fff;
        margin: 0px;
    }

    -->
</style>
<body>
<jsp:include page="../commons/head.jsp"></jsp:include>
<jsp:include page="../commons/superContent.jsp"></jsp:include>
<div class="containerbox">
    <div class="container ">
        <div class="row  column_box">
            <div class="col-md-3  visible-lg visible-md"></div>
            <div class="col-md-9">
                <div class="row">
                    <div class="col-md-12">
                        <ol class="breadcrumb">
                            <li class="active">信仰知识图谱</li>
                            <li class="active">批量上传文档</li>
                        </ol>
                    </div>
                </div>
                <form role="form" action="webfile/addsubmit.do"
                      id="knowSubmitFormId" method="post">
                    <div class="row">
                        <div class="col-md-12">
                            <div class="panel panel-default">
                                <div class="panel-heading center-block webfile-buttonplus"
                                     style="height: 50px;">
                                    <div style="float: left;">
                                        <input type="button" class="btn btn-info btn-xs center-block"
                                               style="padding: 0px; padding-bottom: 8px;" id="uploadButton"
                                               value="上传Excel"/>
                                    </div>
                                </div>
                                <div class="panel-body" id="fileListId">
                                    <div id="fileQueue"></div>
                                    <%--
                                    <input type="hidden" name="fileId" id="uploadfileId"
                                        value="${fileId}" /> <span id="uploadMarkId">${fileName}</span> --%>

                                </div>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>
        <div class="col-md-3  visible-lg visible-md"></div>
        <div class="col-md-9 panel panel-default">
            <div id="result" class="panel-body">

            </div>
        </div>
    </div>
</div>
<jsp:include
        page="/view/web-simple/type/commons/includeChooseTypes.jsp"></jsp:include>
<jsp:include page="../commons/footServer.jsp"></jsp:include>
<!-- /.modal -->
<jsp:include page="../commons/foot.jsp"></jsp:include>
<a onclick=""></a>
</body>
<script>
    KindEditor
        .ready(function (K) {
            var uploadbutton = K
                .uploadbutton({
                    button: K('#uploadButton')[0],
                    fieldName: 'file',
                    url: basePath + 'webfile/batchUpload.do',
                    afterUpload: function (data) {

                        if (data.error === 0) {
                            var html = "";
                            $.each(data.result, function(i,val){
                                console.log(val.doc.id + "  " +val.doc.title);
                                html += "<div class=\"row\"><div class=\"col-sm-12\"><hr class=\"hr_split\"></div><div style=\"margin-left: 4px;\" class=\"pull-left doc_node\"><a class=\"doc_node_title\" href=\"webdoc/view/Pub" + val.doc.id + ".html\">"+ val.doc.title +"</a></div></div>";
                            });
                            $("#result").html(html);
                        } else {
                            alert(data.message);
                        }
                    },
                    afterError: function (str) {
                        alert('自定义错误信息: ' + str);
                    }
                });
            uploadbutton.fileBox.change(function (e) {
                uploadbutton.submit();
            });
        });
</script>
</html>